package com.hl.framework.auth.handler;


import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.AllArgsConstructor;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;




/**
 * 自定义退出处理器
 *
 * @author ruoyi
 */
@AllArgsConstructor
public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler {

    private final SecurityProperties securityProperties;

//    private final MultiUserDetailsAuthenticationProvider authenticationProvider;

    @Override
    public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
        // 执行退出
//        String token = SecurityUtils.obtainAuthorization(request, securityProperties.getTokenHeader());
//        if (StrUtil.isNotBlank(token)) {
//            authenticationProvider.logout(request, token);
//        }
//        // 返回成功
//        ServletUtils.writeJSON(response, CommonResult.success(null));
    }

}
